/*
 * Copyright (c) 2010, Leon Dang f3it.com
 *           (c) 2010, Andrew Korolev redfox14 at gmail dot com
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *   * Redistributions of source code must retain the above copyright notice,
 *     this list of conditions and the following disclaimer.
 *   * Redistributions in binary form must reproduce the above copyright notice,
 *     this list of conditions and the following disclaimer in the documentation
 *     and/or other materials provided with the distribution.
 *   * Neither the name of the Leon Dang & FCUBEDIT nor the names of its
 *     contributors may be used to endorse or promote products derived from
 *     this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#include <QMetaType>

#ifndef SETTINGS_H
#define SETTINGS_H

// Global Variables
#define DB_LOC "/home/user/.rtcom-eventlogger/el-v1.db"
#define CONFIG "/.mcalllog/mcalllogrc"

#define WINDOW_TITLE "Call Log"


// That is no longer true for the el-v1.db of the PR1.2
/*
#define RTCOM_EL_EVENTTYPE_CALL_INBOUND  1 // |1|Incoming call
#define RTCOM_EL_EVENTTYPE_CALL_OUTBOUND 2 // |1|Outgoing call
#define RTCOM_EL_EVENTTYPE_CALL_MISSED   3 // |1|Missed call
#define RTCOM_EL_EVENTTYPE_CALL_VOICEMAIL 4 //|1|Voicemail message
#define RTCOM_EL_EVENTTYPE_CHAT_INBOUND  5 // |2|Incoming chat message
#define RTCOM_EL_EVENTTYPE_CHAT_OUTBOUND 6 // |2|Out coming chat message
#define RTCOM_EL_EVENTTYPE_SMS_INBOUND   7 // |3|Incoming SMS
#define RTCOM_EL_EVENTTYPE_SMS_OUTBOUND  8 // |3|Outgoing SMS
*/

#define ICONS_DIR "/usr/share/icons/hicolor/"

// PushButtons
#define IMG_DIAL	  ICONS_DIR "32x32/hildon/call_dialpad_button.png"
#define IMG_CONTACTS	  ICONS_DIR "32x32/hildon/general_contacts_button.png"

// Call Types / Chat Clients
#define IMG_CELL      ICONS_DIR "32x32/hildon/call_status_cellular.png"
#define IMG_SKYPE     ICONS_DIR "32x32/hildon/general_skype.png"
#define IMG_GOOGLE    ICONS_DIR "32x32/hildon/general_gtalk.png"
#define IMG_SIP       ICONS_DIR "32x32/hildon/general_sip.png"
//#define IMG_OVI       ICONS_DIR "32x32/hildon/general_ovi.png"
//#define IMG_JABBER    ICONS_DIR "32x32/hildon/general_jabber.png"

// Event Directions
#define IMG_OUT       ICONS_DIR "48x48/hildon/general_sent.png"
#define IMG_IN        ICONS_DIR "48x48/hildon/general_received.png"
#define IMG_MISSED    ICONS_DIR "48x48/hildon/general_missed.png"

// SMS'es
#define IMG_SMS_READ      ICONS_DIR "48x48/hildon/general_sms.png"
#define IMG_SMS_UNREAD    ICONS_DIR "48x48/hildon/chat_unread_sms.png"
#define IMG_SMS_REPLIED   ICONS_DIR  "48x48/hildon/chat_replied_sms.png"
/*
	The following 2 statuses can not be found out from el-v1.db. They seem to be stored
	in /var/spool/sms/outgoing or somewhere around. Possibly they can be retrieved from
	com.nokia.phone.SMS D-Bus interface.
*/
#define IMG_SMS_FAILED    ICONS_DIR "48x48/hildon/chat_failed_sms.png"
#define IMG_SMS_PENDING   ICONS_DIR "48x48/hildon/chat_pending_sms.png"

// Chat Messages
#define IMG_CHAT_READ      ICONS_DIR "48x48/hildon/general_chat.png"
#define IMG_CHAT_UNREAD    ICONS_DIR "48x48/hildon/chat_unread_chat.png"
#define IMG_CHAT_REPLIED   ICON_DIR  "48x48/hildon/chat_replied_chat.png"

// Avatars
#define IMG_VOICEMAIL ICONS_DIR "48x48/hildon/general_voicemail_avatar.png"
#define IMG_AVATAR   ICONS_DIR "48x48/hildon/general_default_avatar.png"


// Date Formats
#define FORMAT0 "ddd d MMM yy"
#define FORMAT1 "ddd MM d yy"
#define FORMAT2 "ddd dd.MM.yy"
#define FORMAT3 "ddd MMM d yy"
#define FORMAT4 "dd.MM.yyyy"
#define FORMAT5 "MM/dd/yyyy"
#define FORMAT6 "yyyy-MM-dd"

class OptionsClass
{
public:
	enum FilterOption
	{
		ShowCalls = 0x01,
		ShowSMS = 0x02,

		ShowAll = 0x10,
		ShowIncoming = 0x20,
		ShowOutgoing = 0x40,
		ShowMissed = 0x80
	};
	static const unsigned EventMask =  0x0F;
	static const unsigned DirectionMask = 0xF0;
	Q_DECLARE_FLAGS( FilterOptions, FilterOption )
};
Q_DECLARE_OPERATORS_FOR_FLAGS( OptionsClass::FilterOptions )
//Q_DECLARE_METATYPE( OptionsClass::FilterOptions )
//Q_DECLARE_METATYPE( Qt::WidgetAttribute )

/*!!! This must be exactly the same as in EventTypes table of el-v1.db !!!*/
enum ELDB_EVENT_TYPE
{
	ELDB_CALL = 1,
	ELDB_MISSED_CALL = 3,
	ELDB_VOICEMAIL = 4,
	ELDB_CHAT = 5,
	ELDB_SMS = 7
};

enum EVENT_TYPE
{
	ET_CALL,
	ET_CHAT,
	ET_SMS
};

enum EVENT_DIRECTION
{
	ED_INCOMING,
	ED_OUTGOING,
	ED_MISSED
};

enum CALL_TYPE
{
	CT_NONE,
	CT_CELL,
	CT_SKYPE,
	CT_GOOGLE
};

#endif // SETTINGS_H
